<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:a="http://richfaces.org/a4j"
    template="layout/template.xhtml">

<ui:define name="body">

	<table align="right">
		<tr>
			<td>
				<h:commandButton immediate="true"
					onclick="abrirPopup('help_online/help_funcionario.seam');" 
					title="Ajuda Online"
					alt="Ajuda Online"
					image="img/help_peq.jpg"/>
			</td>
		</tr>
	</table>

	<h2 class="title"><a href="#">Gerenciar Funcionários</a></h2><br/>

            <h:form id="funcionarioForm">
            
	           <h:panelGrid columns="1">
	            	<s:decorate template="/layout/edit.xhtml">
	            		<ui:define name="label">Nome:</ui:define>
	            		<h:inputText value="#{manterFuncionariosController.funcionarioEdicao.dscNome}"
	            			required="true"
	            			maxlength="100"
	            			onkeydown="Mascara(this,Maiusculo)"
							onkeyup="Mascara(this,Maiusculo)"
	            			style="width: 300px;"/>
	            	</s:decorate>
	            	
	            	<s:decorate template="/layout/edit.xhtml">
	            		<ui:define name="label">Cargo:</ui:define>
	            		<h:inputText value="#{manterFuncionariosController.funcionarioEdicao.dscCargo}"
	            			required="false"
	            			maxlength="50"
	            			onkeydown="Mascara(this,Maiusculo)"
							onkeyup="Mascara(this,Maiusculo)"
	            			style="width: 200px;"/>
	            	</s:decorate>
	            	
	            	<s:decorate template="/layout/edit.xhtml">
	            		<ui:define name="label">Telefone Contato:</ui:define>
	            		<h:inputText value="#{manterFuncionariosController.funcionarioEdicao.telContato}"
	            			required="false"
	            			maxlength="14"
	            			style="width: 200px;"
	            			onkeydown="Mascara(this,Telefone);"
	            			onkeyup="Mascara(this,Telefone);"/>
	            	</s:decorate>
	            	
	            	<s:decorate template="/layout/edit.xhtml">
	            		<ui:define name="label">Data de nascimento:</ui:define>
	            		<rich:calendar value="#{manterFuncionariosController.funcionarioEdicao.dtaNascimento}"
	            			datePattern="dd/MM/yyyy"
	            			required="true"
	            			enableManualInput="true"
	            			oninputkeydown="Mascara(this,Data)"
	            			oninputkeyup="Mascara(this,Data)"/>
	            	</s:decorate>
	            	
	            	<s:decorate template="/layout/edit.xhtml">
	            		<ui:define name="label">Data de início na empresa:</ui:define>
	            		<rich:calendar value="#{manterFuncionariosController.funcionarioEdicao.dtaEntrada}"
	            			datePattern="dd/MM/yyyy"
	            			required="true"
	            			enableManualInput="true"
	            			oninputkeydown="Mascara(this,Data)"
	            			oninputkeyup="Mascara(this,Data)"/>
	            	</s:decorate>
	            	
	            	<s:decorate template="/layout/edit.xhtml">
	            		<ui:define name="label">Data de saída da empresa:</ui:define>
	            		<rich:calendar value="#{manterFuncionariosController.funcionarioEdicao.dtaSaida}"
	            			datePattern="dd/MM/yyyy"
	            			enableManualInput="true"
	            			oninputkeydown="Mascara(this,Data)"
	            			oninputkeyup="Mascara(this,Data)"/>
	            	</s:decorate>
	            	
	            	<s:decorate template="/layout/edit.xhtml">
	            		<ui:define name="label">Valor do último salário:</ui:define>
	            		<h:inputText value="#{manterFuncionariosController.funcionarioEdicao.vlrUltimoSalario}" 
	            			maxlength="10"
	            			required="true"
	            			onkeydown="Mascara(this,Valor)"
	            			onkeyup="Mascara(this,Valor)"
	            			converter="conversorMonetario"/>
	            		
	            	</s:decorate>
	            </h:panelGrid>
	            <br/>
	            <div class="actionButtons">
		        	<h:commandButton id="submit" value="Salvar" action="#{manterFuncionariosController.salvar}"
		            	onclick="javascript:if(!confirm('Tem certeza que deseja salvar?'))return false;"/>
		            	
		            <a:commandButton id="cancel" value="Cancelar" 
				        		action="#{manterFuncionariosController.cancelar}" 
				        		ajaxSingle="true"
				        		reRender="funcionarioForm"/>
		        </div>
				<br/>
				
			</h:form>
			
 </ui:define>
</ui:composition>
